﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Xml.Serialization;

namespace Urbania.GUI.Elements
{
    [Serializable]
    [XmlRoot("Element")]
    [XmlInclude(typeof(Button)), XmlInclude(typeof(PopUp)), XmlInclude(typeof(TextElement)), XmlInclude(typeof(Menu)),
    XmlInclude(typeof(RightClickMenu))]
    public abstract class GUIElement
    {
        protected Vector2 position;
        protected GUIElement parent;
        protected LuaVM lua;
        public bool toRemove;

        public bool ToRemove { get { return this.toRemove; } }

        public GUIElement() { }

        public virtual void Load() { }

        public virtual void Update(GameTime gameTime) { }

        public virtual void Update(GameTime gameTime, Vector2 mouse) { }

        public virtual void Update(GameTime gameTime, Microsoft.Xna.Framework.Input.MouseState mouse) { }

        public virtual void Draw(GameTime gameTime, SpriteBatch spriteBatch) { }

        public Vector2 GetPosition() { return this.position; }

        public void SetParent(GUIElement e) { this.parent = e; }

        public void SetLua(ref LuaVM lua) { this.lua = lua; }
    }
}
